package com.sfx.messagequeue.mqClient;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description: 代表一个连接池
 * User: sfx
 * Date: 2023-08-12
 * Time: 20:24
 */
public class ConnectionFactory {
    //Broker Server IP地址
    private String host;
    // Broker Server 端口号
    private int port;

    public Connection newConnection() throws IOException {
        // 根据指定IP + 端口号 创建一个新的连接
        return new Connection(host,port);
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }
}